// 页面设置数据仓库
import { defineStore } from 'pinia';
import { ref } from 'vue';

const useSettingStore = defineStore('setting', () => {
    
    // 设置数据
    const setting = ref({
        // 是否显示侧边栏
        isCollapse: false,
        // 刷新
        refresh: false,
    })

    // 切换侧边栏显示状态
    const toggleSideBar = () => {
        setting.value.isCollapse = !setting.value.isCollapse
    }

    // 修改刷新状态
    const changeRefresh = (value: boolean) => {
        setting.value.refresh = value
    }

    return {
        setting,
        toggleSideBar,
        changeRefresh,
    }

}) 

export default useSettingStore;